package bankapplication.com.acme.bankapp.service.bank;

import java.util.zip.DataFormatException;

import bankapplication.com.acme.bankapp.domain.bank.Bank;

import bankapplication.com.acme.bankapp.domain.bank.Client;
import bankapplication.com.acme.exceptions.*;

public class BankService {
  public static void addClient(Bank bank, Client client) throws ClientExistsException, DataFormatException{
    BankDataLoaderService.saveBank(bank);
    bank.addClient(client);
  }
  public static void printMaximumAmountToWithDraw(Bank bank) throws DataFormatException {
    for(int i=0; i<bank.getClients().size(); i++){
      for(int j=0; j<bank.getClients().get(i).getAcconts().size(); j++){
        System.out.println(bank.getClients().get(i).getAcconts().get(j).maximumAmountToWithdraw());
      }
    }
  }
}
